﻿<%@ Page Title="" Language="C#" MasterPageFile="~/BackOffice.Master" AutoEventWireup="true" CodeBehind="Survey_Report1.aspx.cs" Inherits="BackOffice.Survey_Report1" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
    <table>
        <tr>
            <td>                
                <asp:Label ID="lblVendor" runat="server" Text="Vendor"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtVendor" runat="server"></asp:TextBox>
            </td>
        </tr>

        <tr>
            <td>
                <asp:Label ID="lblDateFrom" runat="server" Text="Date From"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtDateFrom" runat="server"></asp:TextBox>
                <asp:CalendarExtender ID="txtDateFrom_CalendarExtender" runat="server" 
                    TargetControlID="txtDateFrom" Format="yyyy-MM-dd">
                </asp:CalendarExtender>
            </td>
        </tr>

        <tr>
            <td>
                <asp:Label ID="lblDateTo" runat="server" Text="Date To"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtDateTo" runat="server"></asp:TextBox>
                <asp:CalendarExtender ID="txtDateTo_CalendarExtender" runat="server" 
                    TargetControlID="txtDateTo" Format="yyyy-MM-dd">
                </asp:CalendarExtender>
            </td>
        </tr>   
        
        <tr>
            <td>
                <asp:Button ID="btnSearch" runat="server" Text="Search" 
                    onclick="btnSearch_Click" />
            </td>
            <td>
                <asp:Button ID="btnExport" runat="server" Text="Export" 
                    onclick="btnExport_Click" />
            </td>
        </tr>     
    </table>

    <asp:GridView ID="Survey_Report1_Grid" runat="server" 
        AutoGenerateColumns="False" onrowcommand="Survey_Report1_Grid_RowCommand" DataKeyNames="Vendor">
        <Columns>
            <asp:TemplateField HeaderText = "No.">
                <ItemTemplate>
                    <%# Container.DataItemIndex + 1 %>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText = "Vendor">
                <ItemTemplate>                    
                    <asp:LinkButton ID="lbVendor" runat="server" Text='<%#Eval("Vendor") %>'
                    CommandArgument = "<%# ((GridViewRow) Container).RowIndex  %>" CommandName = "Vendor" ></asp:LinkButton>
                </ItemTemplate> 
            </asp:TemplateField>

            <asp:TemplateField HeaderText = "First Answer">
                <ItemTemplate>
                    <asp:Label ID="lblA1" runat="server"><%#Eval("Answer1") %></asp:Label>
                </ItemTemplate> 
            </asp:TemplateField>

            <asp:TemplateField HeaderText = "Second Answer">
                <ItemTemplate>
                    <asp:Label ID="lblA2" runat="server"><%#Eval("Answer2") %></asp:Label>
                </ItemTemplate> 
            </asp:TemplateField>

            <asp:TemplateField HeaderText = "Third Answer">
                <ItemTemplate>
                    <asp:Label ID="lblA3" runat="server"><%#Eval("Answer3") %></asp:Label>
                </ItemTemplate> 
            </asp:TemplateField>

            <asp:TemplateField HeaderText = "Fourth Answer">
                <ItemTemplate>
                    <asp:Label ID="lblA4" runat="server"><%#Eval("Answer4") %></asp:Label>
                </ItemTemplate> 
            </asp:TemplateField>

            <asp:TemplateField HeaderText = "Fifth Answer">
                <ItemTemplate>
                    <asp:Label ID="lblA5" runat="server"><%#Eval("Answer5") %></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText = "Total Feedback">
                <ItemTemplate>
                    <asp:Label ID="lblTotalFeedback" runat="server"><%#Eval("TotalCount") %></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
</asp:Content>
